<%@page import="org.biojava.services.das.dao.CourseManager"%>
<jsp:useBean id="course" class="dasregistry.CourseRegistrationBean" scope="request"/>


<% String title="DAS workshop 2009 - registration";
   String header = title;
%>


<%@ include file="sangerheader.jsp" %>

<% 

CourseManager courseManager = new CourseManager();

boolean isRegisteredUser = false;
if ( email == null ) {
	session.setAttribute("from_page","course_register.jsp");
	session.setAttribute("message","Please login first, before you can register for the DAS workshop");
    response.sendRedirect("login.jsp");		
    
} else {
	
	
	if ( courseManager.isRegisteredUser(email)){
		isRegisteredUser = true;
		course = courseManager.getDataForUser(email);
	}
	



if ( ! courseManager.registrationOpen()   ) {
	if ( ! isRegisteredUser ) {
%>
	
<div id="main">



<h2>Registration closed</h2>

The workshop is fully booked now and the registration has been closed.
If you are a registered participant we will contact you directly per email.
<br/>
If you have any further questions please do not hesitate to contact <a href="mailto:ap3@sanger.ac.uk">ap3@sanger.ac.uk</a>.
<br/>

[<a href="course.jsp">back to workshop program</a>]


</div>	
<%@ include file="sangerfooter.jsp" %>
<%
	return;
	}
}
%>




<div id="main">
[<a href="course.jsp">back to workshop program</a>]

<% if ( courseManager.isRegisteredUser(email) ) { %>
	<br/>
	<img src="img/ok16x16.png"/> You are registered for the workshop.
	

	The following information has been saved for you :
<pre>
<%= courseManager.getDataForUser(email).toString() %>
</pre>	

It is still possible to update your data:

<h2>Update your registration</h2>
	
<%} else {%>
	<h2>Registration for DAS workshop</h2>
	<p>In order to register  for the DAS workshop in March 2009 at the 
Genome Campus, Hinxton, U.K., please fill out this form and press the Submit button.
- You can modify this data at any time later.
</p>
	
<%} %>



<form action="courseRegisterAction.jsp" method="post">

<input type="hidden" name="recordSaved" value="true"/>
<input type="hidden" name="email" value="<%=email %>"/>
<input type="hidden" name="email" value="<%=user.getEmail() %>"/>

<table>
<% 
boolean complete = true;
if ( course.getDinner().equals("please specify") )
	complete =false;

if ( course.getLanguage().equals("please specify") )
	complete =false;

if ((! complete)&&(isRegisteredUser)){
	%>
<tr bgcolor="#cbdced"><td colspan="2" align="center"><strong>Registration is incomplete.</strong>. 
	Please provide the missing information below:</td></tr>	
	<%
}
%>
<tr><td align="right"><strong>email:</strong></td><td><%= email         %></td></tr>
<tr><td align="right"><strong>Email: </strong></td><td><%= user.getEmail() %></td></tr>

<tr>
<td align="right"><strong>Name:</strong></td>
<td><input type="text" size="30" name="name" value="<%=course.getName() %>"></td>
</tr>



<tr><td align="right"><strong>Attending Day 1:</strong> </td>
<td> <select name="day1"> 
	<option value="yes" <% if (course.getDay1().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getDay1().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Monday 9th March)
	</td>
	</tr>

<tr ><td align="right"><strong>Attending Day 2:</strong></td>
<td> <select name="day2"> 
	<option value="yes" <% if (course.getDay2().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getDay2().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Tuesday 10th March)
	</td>
	</tr>
	
	<tr ><td align="right"><strong>Attending Day 3:</strong></td>
<td> <select name="day3"> 
	<option value="yes" <% if (course.getDay3().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getDay3().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Wednesday 11th March - Hackathon)
	</td>
	</tr>
	
	
	<tr><td align="right"><strong>Suggested topic/interest for hackathon on Day3:</strong> </td>
	<td><textarea rows="4" cols="30"  name="suggestedTopic"><%=course.getSuggestedTopic() %></textarea></td>
</tr>

<tr <% if (isRegisteredUser && (course.getLanguage().equals("please specify"))){ %>bgcolor="#cbdced" <%} %>><td align="right"><strong>Programming language preference:</strong></td>
	<td>
	<select name="language"> 
	<option value="please specify" <% if (course.getLanguage().equals("please specify")) out.print("selected"); %>>please specify</option>
	<option value="Java"  <% if (course.getLanguage().equals("Java")) out.print("selected"); %>>Java</option>
	<option value="Perl" <% if (course.getLanguage().equals("Perl")) out.print("selected"); %>>Perl</option>
	</select>
		
	(for the Monday practical part)</td>
</tr>



<tr><td align="right"><strong>Funding:</strong></td>
<td> <select name="funding"> 
	<option value="BioSapiens" <% if (course.getFunding().equals("BioSapiens")){ out.print("selected");} %>>BioSapiens</option>
	<option value="other"      <% if (course.getFunding().equals("other"))     { out.print("selected");} %>>other</option>
	</select> BioSapiens covers the travel expenses for members.
	</td>
	</tr>

<tr><td align="right"><strong>Accomodation required:</strong></td>
<td><select name="accomodation1"> 
	<option value="yes" <% if (course.getAccomodation1().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getAccomodation1().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Sunday 8th March)
	</td> 
</tr>

<tr><td align="right"><strong>Accomodation required:</strong></td>
<td><select name="accomodation2"> 
	<option value="yes" <% if (course.getAccomodation2().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getAccomodation2().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Monday 9th March)
	</td> 
</tr>

<tr><td align="right"><strong>Accomodation required:</strong></td>
<td><select name="accomodation3"> 
	<option value="yes" <% if (course.getAccomodation3().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getAccomodation3().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Tuesday 10th March)
	</td> 
</tr>

<tr><td align="right"><strong>Accomodation required:</strong></td>
<td><select name="accomodation4"> 
	<option value="yes" <% if (course.getAccomodation4().equals("yes")){ out.print("selected");} %>>yes</option>
	<option value="no"  <% if (course.getAccomodation4().equals("no")) { out.print("selected");} %>>no</option>
	</select> (Wednesday 11th March)
	</td> 
</tr>

<tr <% if (isRegisteredUser && (course.getDinner().equals("please specify"))){ %>bgcolor="#cbdced" <%} %>><td align="right"><strong>I will join for the dinner in Cambridge on Monday evening:</strong></td>
	<td>
	<select name="dinner"> 
	<option value="please specify" <% if (course.getDinner().equals("please specify")) out.print("selected"); %>>please specify</option>
	<option value="yes" <% if (course.getDinner().equals("yes")) out.print("selected"); %>>yes</option>
	<option value="no"  <% if (course.getDinner().equals("no")) out.print("selected"); %>>no</option>
	</select>
	</td>
</tr>



<tr><td align="right"><strong>Special (dietary) <br/> requirements:</strong>
<td><textarea rows="4" cols="30"  name="specialRequirement"><%=course.getSpecialRequirement() %></textarea>
</td>
</tr>

<tr><td colspan="2">Room to send any other comment to the organizers:</td></tr>

<tr><td align="right"><strong>Comment:</strong> </td>
	<td><textarea rows="4" cols="30"  name="comment"><%=course.getComment() %></textarea></td>
</tr>

<tr id="row1"><td colspan="2">Once you have booked your flights and you require help with booking a Taxi,
please come back to this page and provide the following data:</td></tr>

<tr id="row1"><td align="right"><strong>Flight arrival date / time:</strong></td>
	<td><input type="text" name="flightArrival" size="30"/ value="<%=course.getFlightArrival() %>"></td>
</tr>
<tr id="row1"><td align="right"><strong>Flight Nr.:</strong> </td>
	<td><input type="text" name="flightArrivalNr" size="30" value="<%=course.getFlightArrivalNr() %>"/></td>
</tr>

<tr id="row1"><td align="right"><strong>Flight departure date / time</strong></td>
	<td><input type="text" name="flightDeparture" size="30" value="<%=course.getFlightDeparture() %>"/></td>
</tr>
<tr id="row1"><td align="right"><strong>Flight Nr.</strong> </td>
	<td><input type="text" name="flightDepartureNr" size="30"value="<%=course.getFlightDepartureNr() %>"/></td>
</tr>







</table>
<% if ( isRegisteredUser ) { %>
<input type="submit" value="Update data" />
<% } else { %>
<input type="submit" value="Register Me" />
<% } %>
</form>


<p>

Please send any feedback, comments and suggestions to <a href="mailto:ap3@sanger.ac.uk">Andreas Prlic</a>

</p>



</div>
<%}%>



<%@ include file="sangerfooter.jsp" %>

